home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / turbopas / qwik55.arc / QWIK55.DOC < prev    next >
Encoding:
Text File  |  1989-08-24  |  80.0 KB  |  2,236 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                               QWIK SCREEN UTILITIES
  22.                                   USER'S GUIDE
  23.  
  24.                                    Version 5.5
  25.                                   March 4, 1989
  26.  
  27.  
  28.                Copyright (C) 1988-1989 Eagle Performance Software
  29.                               All Rights Reserved.
  30.  
  31.  
  32.  
  33.                                _______
  34.                           ____| _     |               (tm)
  35.                        --|       |    |-------------------
  36.                          |   ____|__  |  Association of
  37.                          |  |       |_|  Shareware
  38.                          |__|   o   |    Professionals
  39.                        -----|   |   |---------------------
  40.                             |___|___|    MEMBER
  41.    QWIK Screen Utilities                            User's Guide, Version 5.5
  42.  
  43.  
  44.  
  45.                        T A B L E   O F   C O N T E N T S
  46.  
  47.         1. INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . 3
  48.              Features .  . . . . . . . . . . . . . . . . . . . . . 3
  49.              Using the Manuals . . . . . . . . . . . . . . . . . . 3
  50.              Licensing . . . . . . . . . . . . . . . . . . . . . . 4
  51.              Customer Service  . . . . . . . . . . . . . . . . . . 4
  52.              ASP . . . . . . . . . . . . . . . . . . . . . . . . . 5
  53.  
  54.         2. GETTING STARTED . . . . . . . . . . . . . . . . . . . . 6
  55.              Distribution Files  . . . . . . . . . . . . . . . . . 6
  56.              Demonstration . . . . . . . . . . . . . . . . . . . . 6
  57.              Simple Programming  . . . . . . . . . . . . . . . . . 6
  58.              Procedures and Functions  . . . . . . . . . . . . . . 8
  59.  
  60.         3. BASIC TECHNIQUES  . . . . . . . . . . . . . . . . . . . 11
  61.              Number to String Conversion . . . . . . . . . . . . . 11
  62.              Cursor Mode Routines  . . . . . . . . . . . . . . . . 11
  63.              Cursor Location Routines  . . . . . . . . . . . . . . 13
  64.              EOS Marker  . . . . . . . . . . . . . . . . . . . . . 13
  65.              Scrolling . . . . . . . . . . . . . . . . . . . . . . 14
  66.              Pop-Up Windows  . . . . . . . . . . . . . . . . . . . 15
  67.  
  68.         4. ADVANCED TECHNIQUES . . . . . . . . . . . . . . . . . . 17
  69.              Virtual Screens . . . . . . . . . . . . . . . . . . . 17
  70.              Video Pages . . . . . . . . . . . . . . . . . . . . . 18
  71.              Video Modes . . . . . . . . . . . . . . . . . . . . . 19
  72.              Multi-tasking Environments  . . . . . . . . . . . . . 20
  73.              Interrupts  . . . . . . . . . . . . . . . . . . . . . 20
  74.  
  75.         5. HARDWARE DETECTION  . . . . . . . . . . . . . . . . . . 21
  76.              Display Combination Code  . . . . . . . . . . . . . . 21
  77.              Snow Checking . . . . . . . . . . . . . . . . . . . . 22
  78.              System Hardware . . . . . . . . . . . . . . . . . . . 23
  79.              Tips  . . . . . . . . . . . . . . . . . . . . . . . . 23
  80.  
  81.         APPENDIX A: Video Mode Table . . . . . . . . . . . . . . . 24
  82.  
  83.         APPENDIX B: Cursor Mode Data . . . . . . . . . . . . . . . 26
  84.              Cursor Mode Tables  . . . . . . . . . . . . . . . . . 26
  85.              Cursor Emulation  . . . . . . . . . . . . . . . . . . 26
  86.  
  87.         APPENDIX C: Performance  . . . . . . . . . . . . . . . . . 29
  88.              Code Size . . . . . . . . . . . . . . . . . . . . . . 29
  89.              Speed . . . . . . . . . . . . . . . . . . . . . . . . 29
  90.              TP4 Usage . . . . . . . . . . . . . . . . . . . . . . 30
  91.  
  92.         APPENDIX D: Application Products . . . . . . . . . . . . . 31
  93.  
  94.         APPENDIX E: Revision History . . . . . . . . . . . . . . . 34
  95.  
  96.         APPENDIX F: References and Credits . . . . . . . . . . . . 37
  97.  
  98.  
  99.  
  100.  
  101.                                        2
  102.    QWIK Screen Utilities                            User's Guide, Version 5.5
  103.  
  104.  
  105.    1.  I N T R O D U C T I O N
  106.  
  107.  
  108.    FEATURES
  109.  
  110.    Welcome to QWIK Screen Utilities!
  111.  
  112.    You have just obtained a copy of the highest performance screen writing
  113.    tools available today for Turbo Pascal 5.5 (TP5).  Both novice and
  114.    professional programmers will appreciate these simple and very powerful
  115.    utilities that gives you absolute control over your CRT displays in all
  116.    text modes.
  117.  
  118.    Here are some of the features you will discover:
  119.  
  120.      . Writes on all IBM compatible computers, displays and
  121.        adapters including the new PS/2 systems and Hercules.
  122.      . Superior video detection routine.
  123.      . Eliminates snow and flicker.
  124.      . Writes directly to the screen in absolute coordinates.
  125.      . Writes in all text modes and column modes.
  126.      . Writes on all video pages.
  127.      . Writes on virtual screens in RAM.
  128.      . Writes text and attribute, text only, or attribute only.
  129.      . Reads strings, characters and attributes.
  130.      . Uses End-Of-String (EOS) marker for quick string chaining.
  131.      . Provides standardized cursor control for all adapters.
  132.      . Enhanced cursor movement.
  133.      . 650+% faster than TP5 direct screen writing.
  134.      . Works in multi-tasking environments.
  135.      . Only 2.7k bytes of code if all 45 utilities are used.
  136.      . Optimized by the compiler and drops unused code.
  137.      . Used in all other Eagle products.
  138.  
  139.    QWIK is an enhancement unit providing capabilities not offered in the CRT
  140.    unit that came with TP5.  In contrast to the CRT unit which does window-
  141.    relative writing, QWIK knows how to write directly to the screen in
  142.    absolute screen coordinates for any video configuration.
  143.  
  144.  
  145.    USING THE MANUALS
  146.  
  147.    Disk Based Guides - The manuals for QWIK are on disk so that you can
  148.    conveniently scan for the topic you are seeking.  You can do this with any
  149.    list or search utility with a search function.  You can also make a printed
  150.    copy.  If you have not already printed this manual, refer to the READ.ME
  151.    file for instructions.  At the present time, no bound manuals are being
  152.    offered with registration.
  153.  
  154.    User's Guide - This manual, the one your are reading now, assumes that as a
  155.    programmer you are already familiar with Turbo Pascal 4.0 and that you have
  156.    a working knowledge of your disk operating system (DOS).  It will provide
  157.    you the basic principles of direct screen writing and powerful tips on some
  158.    previously unavailable techniques.
  159.  
  160.  
  161.  
  162.    Chapter 1, Introduction                                             Page 3
  163.    QWIK Screen Utilities                            User's Guide, Version 5.5
  164.  
  165.  
  166.    Reference Guide - This manual describes in detail all procedures, functions
  167.    and variables used in QWIK.  It is alphabetically arranged for easy access
  168.    in a format similar to the TP5 manual.  Use this manual when you have
  169.    become familiar with the basic principles in the User's guide.
  170.  
  171.  
  172.    LICENSING
  173.  
  174.    Registration - These utilities and the documentation have been released for
  175.    distribution as Shareware.  You have been given the chance to sample the
  176.    full capability of QWIK without risk!  If you find that QWIK is a valuable
  177.    tool, then you are expected to register.  You will find a reasonable
  178.    licensing schedule found in LICENSE.ARC to meet private or commercial
  179.    needs.  When registering, be sure to specify the version for Turbo Pascal
  180.    (such as TP4 or TP5) you wish to receive.
  181.  
  182.    Source Code - All registered users will receive source code when the signed
  183.    license agreement is returned with the registration.
  184.  
  185.  
  186.    CUSTOMER SERVICE
  187.  
  188.    If you have questions, comments, or suggestions, the Eagle can be contacted
  189.    by four means - (1) CompuServe, (2) telephone, (3) The Eagle BBS, or
  190.    (4) mail.
  191.  
  192.    CompuServe - The most dependable way to contact the Eagle is through
  193.    CompuServe.  James (Jim) H. LeMay has written the TP5 version of QWIK, but
  194.    the person to contact is Jordan Gallagher who can be contacted on the
  195.    Borland Forum by typing GO BPROGA from the CompuServe main menu.  You will
  196.    enter the Forum for Turbo Pascal.  You can contact Jordan with his PPN
  197.    number of 73557,2342.  Messages can also be left through EasyPlex.
  198.  
  199.    Telephone - Jordan can also be reached by phone at (214) 539-7855 on
  200.    weekdays and Saturday from 9:00 a.m. to 8:00 p.m CST.
  201.  
  202.    The Eagle BBS - You can also contact us on our 24-hour BBS at (214) 539-
  203.    9878, 1200/2400 N81.
  204.  
  205.    Mail - For registration or problems, please write:
  206.  
  207.        Eagle Performance Software
  208.        TP/TC products
  209.        P.O. Box 292786
  210.        Lewisville, TX  75029-2786
  211.  
  212.    In your written request for resolving problems, be sure to include:
  213.  
  214.      . A 5 1/4 inch diskette of compilable source code of the problem.
  215.      . The Eagle product and version number.
  216.      . The computer make and model.
  217.      . The type of video card, video monitor and keyboard.
  218.  
  219.  
  220.  
  221.  
  222.  
  223.    Chapter 1, Introduction                                             Page 4
  224.    QWIK Screen Utilities                            User's Guide, Version 5.5
  225.  
  226.  
  227.    ASP
  228.  
  229.    QWIK is a shareware program conforming to the standards of the Association
  230.    of Shareware Professionals (ASP).  You can get more information about ASP
  231.    by writing to:
  232.  
  233.      Association of Shareware Professionals
  234.      P.O. Box 5786
  235.      Bellevue,WA 98006
  236.  
  237.    This program is produced by a member of the Association of Shareware
  238.    Professionals (ASP).  ASP wants to make sure that the shareware principle
  239.    works for you.  If you are unable to resolve a shareware-related problem
  240.    with an ASP member by contacting the member directly, ASP may be able to
  241.    help.  The ASP Ombudsman can help you resolve a dispute or problem with an
  242.    ASP member, but does not provide technical support for member's products.
  243.    Please write to:
  244.  
  245.      ASP Ombudsman
  246.      P.O. Box 5786
  247.      Bellevue,WA 98006
  248.  
  249.    or send a CompuServe message via EasyPlex to ASP Ombudsman 7007,3536.
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.    Chapter 1, Introduction                                             Page 5
  285.    QWIK Screen Utilities                            User's Guide, Version 5.5
  286.  
  287.  
  288.    2.  G E T T I N G   S T A R T E D
  289.  
  290.    This section will acquaint you with the files on disk and show you a
  291.    brief demonstration.  You will also run your first program with QWIK and
  292.    then become familiar with all of the utilities.
  293.  
  294.  
  295.    DISTRIBUTION FILES
  296.  
  297.    In this version, QWIK55.ARC contains:
  298.  
  299.      Qwik55  .tpu:  Compiled unit of 2000 lines of assembly for TP5.
  300.      Qwik55  .pas:  Source code for QWIK55.TPU.  (MASM source code and
  301.                     object files are not included.)
  302.      Qwik55  .doc:  This document - a user's guide to QWIK.
  303.      QwikDemo.pas:  A demonstration program showing the features and
  304.                     speed of all procedures and is written primarily
  305.                     for color cards, but also works on mono cards.
  306.      QwikRef .doc:  QWIK Reference Guide document covering each
  307.                     procedure and variable in detail.
  308.      Qinitest.pas:  A program that verifies the equipment detected by
  309.                     the Qinit procedure.
  310.      Qbench  .pas:  A timing program that shows "screens/second" for
  311.                     typical QWIK procedures.
  312.      Strs    .pas:  Supplementary unit for number to string
  313.                     conversions.
  314.      TimerD12.inc:  Include file to measure elapsed time.
  315.      License .arc:  ARC file containing license agreements.
  316.  
  317.  
  318.    DEMONSTRATION
  319.  
  320.    To get an overview of the speed and features of QWIK, let's run a
  321.    demonstration program that came with the utilities.  Do the following
  322.    steps.
  323.  
  324.      1. Copy QWIK55.TPU to QWIK.TPU for TP5.
  325.      2. If you are running programs in a multi-tasking
  326.         environment, instruct the environment that you are NOT
  327.         writing direct to the screen.  Also set text pages to 2.
  328.      3. Make, compile and run QWIKDEMO.PAS to get a feel for
  329.         features and speed.
  330.      4. Press return when the screen prompts you to continue with
  331.         "... press any key".
  332.      5. Before running QINITEST.PAS, read the source code header
  333.         to see if you want to test for a computer submodel ID.
  334.  
  335.  
  336.    SIMPLE PROGRAMMING
  337.  
  338.    First Program - Let's write a short program to see how simple it is to
  339.    write with QWIK.  While in the TP editor, enter the following code:
  340.  
  341.      uses Crt,Qwik;
  342.      begin
  343.  
  344.  
  345.    Chapter 2, Getting Started                                          Page 6
  346.    QWIK Screen Utilities                            User's Guide, Version 5.5
  347.  
  348.  
  349.        TextAttr := Yellow+BlackBG;
  350.        ClrScr;
  351.        Qwrite (5, 1,Yellow+BlueBG,'QWIK writing');
  352.        Qwrite (5,13,Yellow+BlueBG,' is easy!');
  353.      end.
  354.  
  355.    Assuming you have already copied QWIK55.TPU to QWIK.TPU, compile and run
  356.    the code.  You can then see the text "QWIK writing is easy!" starting on
  357.    row 5, column 1.  On color monitors, the text is a yellow foreground with a
  358.    blue background while monochrome monitors show high intensity on black.
  359.  
  360.    Row/Col vs. X/Y - You probably noticed that the row parameter is first and
  361.    the column parameter is second.  Since QWIK is entirely for text modes, it
  362.    is more intuitive to specify the row first and the column second just like
  363.    any word processor.  The X/Y scheme is better suited for graphics.
  364.  
  365.    Attributes - Notice that our example uses the constant "BlueBG".  QWIK
  366.    provides eight convenient background color constants to use along with
  367.    Turbo's 16 foreground colors.  The same names are used, but the "BG" suffix
  368.    is added:
  369.  
  370.       BlackBG       RedBG
  371.       BlueBG        MagentaBG
  372.       GreenBG       BrownBG
  373.       CyanBG        LightGrayBG
  374.  
  375.    These allow QWIK to make the most of Turbo's constant folding.  By simply
  376.    adding the foreground and background constants together, the compiler saves
  377.    the result as a single word.  And, by simply reading the Qwrite statement,
  378.    what you see is what you get (WYSIWYG).
  379.  
  380.    Readable Code - As an added benefit, QWIK was designed with human factors
  381.    in mind and was made so that it is very easy to read the code you create.
  382.    With the row, column, and attribute parameters first and the string last,
  383.    you can see that the two Qwrite statements were easily aligned.  WYSIWYG to
  384.    the rescue again!
  385.  
  386.    Chaining - Notice that we had to calculate the string length of "QWIK
  387.    writing" before we could locate the string " is easy".  Let's modify the
  388.    last statement to indeed make it easier to locate the last string:
  389.  
  390.      uses Crt,Qwik;
  391.      begin
  392.        TextAttr := Yellow+BlackBG;
  393.        ClrScr;
  394.        Qwrite (5, 1,Yellow+BlueBG,'QWIK writing');
  395.        QwriteEos   (Yellow+BlueBG,' is easy!');
  396.      end.
  397.  
  398.    Now that was really easy!  How did QwriteEos know where to write?  QWIK
  399.    internally keeps track of an End-Of-String (EOS) marker so that any
  400.    subsequent "Eos" procedure like QwriteEos will chain the next string right
  401.    there - no rows or columns to calculate!  And you can chain as many as you
  402.    want on to any other QWIK procedure.
  403.  
  404.  
  405.  
  406.    Chapter 2, Getting Started                                          Page 7
  407.    QWIK Screen Utilities                            User's Guide, Version 5.5
  408.  
  409.  
  410.    Same Attribute - But suppose we did not want to change the attribute that
  411.    was already on the screen and don't even know what it is.  How is that
  412.    done?  Just modify the attributes to the following:
  413.  
  414.      uses Crt,Qwik;
  415.      begin
  416.        TextAttr := LightGray+BlackBG;
  417.        ClrScr;
  418.        Qwrite (5, 1,SameAttr,'QWIK writing');
  419.        QwriteEos   (SameAttr,' is easy!');
  420.      end.
  421.  
  422.    The special constant SameAttr (which is negative) tells QWIK to simply
  423.    enter the text on the screen without changing the attribute.  The result of
  424.    the program would show the text with LightGray on Black attributes.  This
  425.    special constant works on all QWIK utilities.  When assigned to a variable,
  426.    the attribute can even be switched at run time.
  427.  
  428.    Centering - Rather than having the text left justified, let's center the
  429.    text on the screen by modifying a portion of the code:
  430.  
  431.      ...
  432.        ClrScr;
  433.        QwriteC (5, 1,80,SameAttr,'QWIK writing is easy!');
  434.      end.
  435.  
  436.    This will place the text on row 5 centered between columns 1 and 80 which
  437.    is perfect for an 80 column text mode.  But what if other text or column
  438.    modes are used?  How can we ensure that it is always centered?  Only one
  439.    simple change is needed:
  440.  
  441.      ...
  442.        ClrScr;
  443.        QwriteC (5, 1,CRTcols,SameAttr,'QWIK writing is easy!');
  444.      end.
  445.  
  446.    The variable CRTcols always has the value of the column width that is
  447.    currently being used.  How does it know?  QWIK is initialized at startup by
  448.    executing a procedure called Qinit.  It detects a host of information about
  449.    your video configuration, everything from the type of video card you are
  450.    using to the shape of the cursor being used.  You can see a list of all
  451.    these variables available for your use in QWIKREF.DOC.
  452.  
  453.  
  454.    PROCEDURES AND FUNCTIONS
  455.  
  456.    Now that you have a basic idea of what QWIK can do, let's make a brief
  457.    survey of all the utilities in QWIK.TPU to just know what is available:
  458.  
  459.      One initializing procedure:
  460.  
  461.          Qinit       - Initializing procedure executed by QWIK.TPU which
  462.                        sets the global variables for the QWIK procedures.
  463.                        It should be executed again after a change from one
  464.                        text mode to another.
  465.  
  466.  
  467.    Chapter 2, Getting Started                                          Page 8
  468.    QWIK Screen Utilities                            User's Guide, Version 5.5
  469.  
  470.  
  471.  
  472.      Three quick direct screen writing procedures, all work with or
  473.      without attribute change:
  474.  
  475.          Qwrite      - For any type string or character (char).
  476.          QwriteC     - For any type string or char; self-centering.
  477.          QwriteA     - For any type variable, arrays or substrings.
  478.  
  479.      Four quick direct screen filling procedures in Rows-by-Cols block
  480.      parameters:
  481.  
  482.         Qfill        - Repetitive filling with the same character; with or
  483.                        without attribute change.
  484.         QfillC       - Same as Qfill, but self-centering.
  485.         Qattr        - Repetitive filling with an attribute only.
  486.         QattrC       - Same as Qattr, but self-centering.
  487.  
  488.      Two quick screen storing procedures:
  489.  
  490.         QstoreToMem  - Saves a Rows-by-Cols block to memory.
  491.         QstoreToScr  - Restores a Rows-by-Cols block to any screen page.
  492.  
  493.      Two quick screen storing procedures for copying blocks between a
  494.      screen (Scr) and a virtual screen (Vscr - a screen in memory):
  495.  
  496.         QScrToVscr   - Copies a Rows-by-Cols block from QWIK screen to
  497.                        virtual screen.
  498.         QVscrToScr   - Restores a Rows-by-Cols block from a virtual screen
  499.                        to the QWIK screen.
  500.  
  501.      Three quick screen reading functions for reading data from any
  502.      screen:
  503.  
  504.          QreadStr    - Reads a string of text.
  505.          QreadChar   - Reads a single character.
  506.          QreadAttr   - Reads an attribute.
  507.  
  508.      Two quick scrolling procedures work on any video page and also
  509.      virtual screens without flicker or snow:
  510.  
  511.          QscrollUp   - Scroll affected rows-by-cols block up.
  512.          QscrollDown - Scroll affected rows-by-cols block down.
  513.  
  514.      Two quick video page changing procedures:
  515.  
  516.          QviewPage   - Changes the page to be displayed - up to 8!
  517.          QwritePage  - Sets the page on which the QWIK procedures are
  518.                        writing.  You don't have to write just on the
  519.                        displayed page!
  520.  
  521.      Three quick cursor procedures and functions which work on any video
  522.      page.  They now work on the page being written rather than viewed:
  523.  
  524.          GotoRC      - Move cursor to absolute row and column coordinates
  525.                        rather than relative to a window.
  526.  
  527.  
  528.    Chapter 2, Getting Started                                          Page 9
  529.    QWIK Screen Utilities                            User's Guide, Version 5.5
  530.  
  531.  
  532.          WhereR      - Returns absolute cursor row.
  533.          WhereC      - Returns absolute cursor column.
  534.  
  535.      Eight quick EOS (End-Of-String) marker procedures and functions that
  536.      alter its position and/or the cursor.  The marker can be moved on the
  537.      CRT and virtual screens, while the cursor movement is only on the
  538.      page being written:
  539.  
  540.           GotoEos      - Moves cursor to EOS marker (like TP write).
  541.           EosR         - Returns absolute row of EOS marker.
  542.           EosC         - Returns absolute col of EOS marker.
  543.           EosToRC      - Sets EOS to a given row and column.
  544.           EosToRCrel   - Relatively shifts EOS by a number of rows and
  545.                          columns, and can be negative or positive.
  546.           EosToCursor  - Matches EOS to the cursor position.
  547.           EosLn        - Moves EOS to column 1 of the next row.
  548.           QEosLn       - Like EosLn, but scrolls up if past last row.
  549.  
  550.      Three cursor routines alter the cursor mode:
  551.  
  552.          GetCursor    - Get current cursor mode from low memory.
  553.          SetCursor    - Sets new cursor mode.
  554.          ModCursor    - Modifies cursor mode to on, off or erratic
  555.                         blink saving current scan lines.
  556.  
  557.      Four quick EOS writing procedures that chain write at the EOS marker:
  558.  
  559.          QwriteEos    - like Qwrite.
  560.          QwriteEosA   - like QwriteA.
  561.          QfillEos     - like Qfill.
  562.          QattrEos     - like Qattr.
  563.  
  564.      A Submodel identification routine:
  565.  
  566.          GetSubModelID - Optional procedure to find IBM submodel ID.
  567.  
  568.      A routine to set screen pointers to Multi-tasking video buffers:
  569.  
  570.          SetMultiTask - Alters QWIK to write to the multi-tasking buffer.
  571.  
  572.      Five string functions that convert integers and reals to strings by
  573.      using the supplementary STRS unit:
  574.  
  575.          StrL   - converts LongInt to string
  576.          StrLF  - converts LongInt to string in a fixed Field
  577.          StrR   - converts Real to string
  578.          StrRF  - converts Real to string in a fixed Field
  579.          StrRFD - converts Real to string in a fixed Field with a
  580.                   specified number of Decimals
  581.  
  582.    For a full description of each utility with its parameters, please refer to
  583.    QWIKREF.DOC for a summary of details and examples.
  584.  
  585.  
  586.  
  587.  
  588.  
  589.    Chapter 2, Getting Started                                          Page 10
  590.    QWIK Screen Utilities                            User's Guide, Version 5.5
  591.  
  592.  
  593.    3.  B A S I C   T E C H N I Q U E S
  594.  
  595.  
  596.    NUMBER TO STRING CONVERSION
  597.  
  598.    Str Procedure - TP5 handily converts numbers into strings with the Str
  599.    procedure.  For example:
  600.  
  601.      var MyNumber: integer;
  602.          MyString: string;
  603.      begin
  604.        Str (MyNumber:7,MyString);
  605.        Qwrite ( 1, 1,SameAttr,MyString);
  606.      end.
  607.  
  608.    But this means that a data area must be reserved and the code isn't as
  609.    readable as it could be.
  610.  
  611.    Str Functions - Instead, QWIK and the supplementary STRS unit let you use a
  612.    function form of Str:
  613.  
  614.      uses Qwik, Strs;
  615.      var MyNumber: integer;
  616.      begin
  617.        Qwrite ( 1, 1,SameAttr,StrLF(MyNumber,7));
  618.      end.
  619.  
  620.    Just like WriteLn, this lets the number remain in the Qwrite statement.
  621.    There are five functions in the STRS unit and they can be used just like
  622.    any other function:
  623.  
  624.      StrL   - converts LongInt to string
  625.      StrLF  - converts LongInt to string in a fixed Field
  626.      StrR   - converts Real to string
  627.      StrRF  - converts Real to string in a fixed Field
  628.      StrRFD - converts Real to string in a fixed Field with a specified
  629.               number of Decimals
  630.  
  631.    The suffixes mean:
  632.  
  633.      L - LongInt, but any scalar will work
  634.      R - Real
  635.      F - Field width that is right justified format
  636.      D - Number of decimals in the format
  637.  
  638.    The Str* functions actually use the Str procedure from TP5 to do the
  639.    conversion.  But with an InLine code trick, functions were created that
  640.    don't recopy the string for the greatest speed.  The code useage is
  641.    also reduced.
  642.  
  643.  
  644.    CURSOR MODE ROUTINES
  645.  
  646.    Three Routines - If you have ever struggled with controlling the shape of
  647.    the cursor, your life is about to be made easier.  With just three
  648.  
  649.  
  650.    Chapter 3, Basic Techniques                                         Page 11
  651.    QWIK Screen Utilities                            User's Guide, Version 5.5
  652.  
  653.  
  654.    routines, SetCursor, GetCursor, and ModCursor, you can consistently and
  655.    reliably control the cursor mode (shape and visibility) on any video card!
  656.  
  657.    Four Standard Modes - To make it even easier, four standard cursor mode
  658.    variables are initialized at startup to fit the exact requirements of the
  659.    detected video card.  They are:
  660.  
  661.      CursorUnderline - The standard underline cursor.
  662.      CursorHalfBlock - The half block shape usually used for insert
  663.                        editing.
  664.      CursorBlock     - An easy to find full cell cursor.
  665.      CursorInitial   - The mode detected at start up.
  666.  
  667.    So, if we wanted a full block cursor, only one line of code is needed:
  668.  
  669.      SetCursor (CursorBlock);
  670.  
  671.    And that's it!  There's nothing else to figure out - even if you are using
  672.    something like 43-row mode on an EGA card.  When ending your programs, you
  673.    can get back to the original cursor mode by using:
  674.  
  675.      SetCursor (CursorInitial);
  676.  
  677.    Hidden Cursor - Many programs need to hide the cursor altogether.  This can
  678.    be done with ModCursor:
  679.  
  680.      ModCursor (CursorOff);
  681.  
  682.    Why use ModCursor instead of SetCursor?  ModCursor leaves the shape of the
  683.    cursor alone, and only alters bits 13 and 14 of the cursor mode to turn it
  684.    on or off.  In fact there are three constants that are useful with
  685.    ModCursor:
  686.  
  687.      CursorOff   ($2000) - To turn the cursor off.
  688.      CursorOn    ($0000) - To turn the cursor back on with the same shape.
  689.      CursorBlink ($6000) - To create erratic blinking on MDA/CGA.  (On
  690.                            EGA/VGA, it turns the cursor off.)
  691.  
  692.    Using your imagination, you can also mix and match the constants and
  693.    variables by logically summing them.  Let's say we want to change the shape
  694.    of the cursor to a block while it is still turned off:
  695.  
  696.      SetCursor (CursorBlock or CursorOff);
  697.  
  698.    So, the next time ModCursor(CursorOn) is used, the cursor will be a full
  699.    block.  As a suggestion for terminating your program, be sure to restore
  700.    the cursor in your exit procedure with:
  701.  
  702.      SetCursor (CursorInitial);
  703.  
  704.    GetCursor - This function simply returns the current cursor mode value
  705.    stored in low memory allowing you to save it for later use.
  706.  
  707.  
  708.  
  709.  
  710.  
  711.    Chapter 3, Basic Techniques                                         Page 12
  712.    QWIK Screen Utilities                            User's Guide, Version 5.5
  713.  
  714.  
  715.    CURSOR LOCATION ROUTINES
  716.  
  717.    QWIK has three routines that complement the CRT unit - GotoRC, WhereR, and
  718.    WhereC.  They correspond with the familiar GotoXY, WhereX, and WhereY.
  719.    However, there are some important differences:
  720.  
  721.      . The QWIK routines are absolute to the screen and are not restricted
  722.        by the Turbo window.
  723.      . The suffixes "R" and "C" mean row and column, so the parameters of
  724.        GotoRC are reversed from GotoXY.
  725.      . The QWIK routines will also work on any video page.  This is
  726.        explained in the Advanced Techniques section later.
  727.  
  728.    This is not the only way to move the cursor.  The EOS marker is also a very
  729.    powerful aid as you will see in the next topic.
  730.  
  731.  
  732.    EOS MARKER
  733.  
  734.    Invisible Alternate Cursor - From the examples in the Simple Programming
  735.    topic, we found that we could easily chain two strings together using the
  736.    EOS marker.  In fact, this marker is so versatile, the EOS marker utilities
  737.    can be made interchangeable with the cursor, but much faster.  You could
  738.    think of it as an alternate cursor that is invisible.
  739.  
  740.    Keeping Track - Any time a QWIK writing procedure is used, the EOS marker
  741.    is updated.  It is actually saved as the global variable QEosOfs.
  742.    Technically, the value is the offset from the screen base and is a 0-based
  743.    byte count.  For example, if the following procedure was executed:
  744.  
  745.      Qwrite (6,5,Yellow,'Important Data');
  746.  
  747.    the EOS would be at row 6, column 19, right after the word "Data".  The
  748.    value of QEosOfs on an 80 column screen would be:
  749.  
  750.      QEosOfs = ((Row-1)*CRTcols + (Col-1)) * 2 = 836
  751.  
  752.    QWIK does not need to calculate this value, but simply saves it after
  753.    writing, so it is very efficient.  From the overview, you are already aware
  754.    of the four routines that will start writing at this marker - QwriteEos,
  755.    QwriteEosA, QfillEos, and QattrEos.  But what about changing the location
  756.    of the marker itself?  Keep reading.
  757.  
  758.    Moving the Marker - QWIK has four routines that will manually move the EOS
  759.    marker:
  760.  
  761.      EosToRC      - Sets EOS to a given row and column.
  762.      EosToRCrel   - Relatively shifts EOS by a number of rows and
  763.                     columns, and can be negative or positive.
  764.      EosLn        - Moves EOS to column 1 of the next row.
  765.      QEosLn       - Like EosLn, but scrolls up if past last row.
  766.  
  767.    The basic procedure EosToRC moves the EOS marker exactly like GotoRC does
  768.    for the cursor.  But there are also several ways to move the marker
  769.    relatively.  Let's test a short program:
  770.  
  771.  
  772.    Chapter 3, Basic Techniques                                         Page 13
  773.    QWIK Screen Utilities                            User's Guide, Version 5.5
  774.  
  775.  
  776.  
  777.      uses Crt,Qwik;
  778.      begin
  779.        TextAttr := Yellow;
  780.        ClrScr;
  781.        Qwrite     ( 1, 1,Yellow+BlueBG,'First  Row ');
  782.        EosLn;                                           { Jump to (2,1) }
  783.        QwriteEos        (Yellow+BlueBG,'Second Row ');
  784.        EosToRC    ( 3, 1);                              { Jump to (3,1) }
  785.        QwriteEos        (Yellow+BlueBG,'Third  Row ');
  786.        EosToRCrel ( 1,-4);                              { Jump to (4,8) }
  787.        QwriteEos        (Yellow+BlueBG,       'etc.');
  788.        EosToRC    (succ(EosR),8);                       { Jump to (5,8) }
  789.        QwriteEos        (Yellow+BlueBG,       'etc.');
  790.      end.
  791.  
  792.    Compile and run the program.  You should see "Row" and "etc." all aligned
  793.    in one column.  So, you can see that there are several simple ways to move
  794.    the marker!
  795.  
  796.    EOS and the Cursor - You can also interface the EOS marker and the cursor
  797.    with two procedures:
  798.  
  799.      GotoEos      - Moves cursor to match the EOS marker.
  800.      EosToCursor  - Sets the EOS marker to match the cursor position.
  801.  
  802.    It can't get any simpler than that!  Now you can see that:
  803.  
  804.      Qwrite (1,1,Yellow,'Test Line');
  805.      GotoEos;
  806.  
  807.    and,
  808.  
  809.      TextAttr := Yellow;
  810.      GotoXY (1,1);
  811.      Write ('Test Line');
  812.  
  813.    produce identical results.  But QWIK is much faster!
  814.  
  815.  
  816.    SCROLLING
  817.  
  818.    Improved Control - With the CRT unit, you can only control the full screen
  819.    size with WriteLn.  But with the two QWIK routines, QscrollUp and
  820.    QscrollDown, you can define any area to be scrolled:
  821.  
  822.       QscrollUp ( 2, 2,CRTrows-2,CRTcols-2,MyAttr);
  823.  
  824.    This example scrolls a portion of the screen starting at (2,2) leaving a
  825.    one character border.  In a 25x80 text mode, it clears row 24 from column 2
  826.    to 79.  In addition, the cleared row attribute is MyAttr.
  827.  
  828.    Improved Performance - With QscrollDown and QscrollUp (called Qscroll* for
  829.    brevity), your programs can overcome the BIOS problems on many machines.
  830.    Transparent to you, these procedures work on all cards and machines without
  831.  
  832.  
  833.    Chapter 3, Basic Techniques                                         Page 14
  834.    QWIK Screen Utilities                            User's Guide, Version 5.5
  835.  
  836.  
  837.    flicker or snow and operate at three speeds:
  838.  
  839.      Maximum  - for video cards without snow
  840.      Fast CGA - for CGA cards on 80286 machines or better
  841.      Slow CGA - for CGA cards on 8086/8088 machines
  842.  
  843.    Qinit detects the CPU ID and video card to select the fastest algorithm.
  844.    All speeds use 16-bit transfers rather than 8-bit.  So, you can be assured
  845.    of the highest performance.
  846.  
  847.    Cursor Location - These routines do not move the cursor.  However, EOS is
  848.    pointing to the first column of the blank line and GotoEos will move the
  849.    cursor there if needed.
  850.  
  851.    QEosLn - This procedure is another alternative to full screen scrolling.
  852.    It has the same function as EosLn, but will additionally scroll the screen
  853.    up if the EOS marker is past the last row.  Then it simply calls QscrollUp.
  854.    The attribute of the cleared row is the global variable ScrollAttr.  You
  855.    must set this prior to using QEosLn.
  856.  
  857.  
  858.    POP-UP WINDOWS
  859.  
  860.    QWIK has the basic tools to create and remove pop-up windows.  Let's try to
  861.    create one.  While in the TP editor, enter the following code:
  862.  
  863.      uses Crt,Qwik;
  864.      var
  865.        MyWindow,MyUnderlay: array[1..250] of word;
  866.      begin
  867.        { -- Fill the screen with a hatch character. -- }
  868.        Qfill ( 1, 1,CRTrows,CRTcols,LightGray+BlackBG,#176);
  869.        { -- Create a pop-up window.-- }
  870.        QstoreToMem ( 5,12,10,25,MyUnderlay);  { Save area to be covered }
  871.        Qfill       ( 5,12,10,25,Black+LightGray,' ');  { Clear the area }
  872.        QwriteC (9,12,36,SameAttr,'Pop-Up Window');     { Label window   }
  873.        delay (1000);                                   { Wait a sec     }
  874.        QstoreToMem ( 5,12,10,25,MyWindow);             { Save a copy    }
  875.        QstoreToScr ( 5,12,10,25,MyUnderlay);           { Restore screen }
  876.        { -- Move window some where else. -- }
  877.        QstoreToMem ( 8,25,10,25,MyUnderlay);  { Save area to be covered }
  878.        QstoreToScr ( 8,25,10,25,MyWindow);             { Move window    }
  879.        delay (1000);                                   { Wait a sec     }
  880.        { -- Remove window. -- }
  881.        QstoreToScr ( 8,25,10,25,MyUnderlay);           { Restore screen }
  882.      end.
  883.  
  884.    Compile and run the code.  You will see a 10 row by 25 column window
  885.    located at (5,12) which is row 5, column 12 .  After one second, it will be
  886.    moved to (8,25).  Then after another second, it is removed from the screen.
  887.    We did a lot of work with very little code!
  888.  
  889.    Rows-by-Cols - QstoreToScr and QstoreToMem are screen saving and restoring
  890.    procedures that conveniently work in row-by-column blocks.  They
  891.    accommodate any column mode, so there is no need to be concerned about
  892.  
  893.  
  894.    Chapter 3, Basic Techniques                                         Page 15
  895.    QWIK Screen Utilities                            User's Guide, Version 5.5
  896.  
  897.  
  898.    screen width.
  899.  
  900.    Memory Requirements - Notice that QstoreToMem wrote the data direct to
  901.    memory in MyWindow.  It is important that the memory allocated to that
  902.    variable is correct to prevent it from overwriting any other variables.
  903.    The array size chosen was a 250 word array which is a perfect fit since one
  904.    word is needed for each character and attribute on the screen.  If you
  905.    prefer, the heap can also be used such as:
  906.  
  907.      var MyUnderlay: pointer;
  908.      begin
  909.        GetMem (MyUnderlay,500);
  910.        QstoreToMem ( 5,12,10,25,MyUnderlay^);
  911.        { ... }
  912.        FreeMem (MyUnderlay,500);
  913.      end.
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.    Chapter 3, Basic Techniques                                         Page 16
  956.    QWIK Screen Utilities                            User's Guide, Version 5.5
  957.  
  958.  
  959.    4.  A D V A N C E D   T E C H N I Q U E S
  960.  
  961.    This section will acquaint you with the powerful virtual screen writing
  962.    features already built into QWIK.  You will also find out easy it is to
  963.    work on multiple video pages and how to accommodate video mode changes.
  964.  
  965.  
  966.    VIRTUAL SCREENS
  967.  
  968.    This topic will show you how to create and use powerful virtual screens.
  969.  
  970.    Virtual Screen - Just what is a virtual screen?  It is a screen maintained
  971.    in RAM of any dimensions that can be reproduced on the CRT in full or in
  972.    part.  The advantages are:
  973.  
  974.      . Variable row-by-column screen
  975.      . Large video buffer up to 64k
  976.      . High speed in RAM
  977.      . Unlimited number of screens
  978.  
  979.    Screen Record - QWIK uses seven variables to define any screen.  At start
  980.    up, QWIK initializes them to the video system detected:
  981.  
  982.      CRTrows  - Number of rows
  983.      CRTcols  - Number of columns
  984.      CRTsize  - Byte allocation for screen
  985.      Qsnow    - True if snow checking needed
  986.      QEosOfs  - EOS offset
  987.      QScrOfs  - Screen offset
  988.      QScrSeg  - Screen segment
  989.  
  990.    To make data access even easier, all these variables are contained in the
  991.    record QScrRec of VScrRecType.  In addition, QScrPtr is absolute to QScrOfs
  992.    and QScrSeg.  This gives QWIK a true far pointer, so screens can be
  993.    anywhere in memory and not just paragraph aligned!
  994.  
  995.    Creating Virtual Screens - In three easy steps, you can easily create a
  996.    virtual screen:
  997.  
  998.      1. Allocate memory for the screen.
  999.      2. Save the current screen record.
  1000.      3. Modify the screen record for the virtual screen.
  1001.  
  1002.    Let's write some code that does just that:
  1003.  
  1004.      uses Qwik;
  1005.      var  CRTrec,VScrRec: VScrRecType;
  1006.      begin
  1007.        with VScrRec do             { create specs for virtual screen }
  1008.          begin
  1009.            Vrows := 80;            { Let's choose 80 rows }
  1010.            Vcols := 100;           { Let's choose 100 columns }
  1011.            Vsize := Vrows * Vcols shl 1;
  1012.            Vsnow := false;         { Can always be false }
  1013.            VEosOfs := 0;           { Be safe and start at the base }
  1014.  
  1015.  
  1016.    Chapter 4, Advanced Techniques                                      Page 17
  1017.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1018.  
  1019.  
  1020.            GetMem (VScrPtr,Vsize); { Allocate heap space }
  1021.          end;
  1022.        CRTrec  := QScrRec;         { Save CRT specs     }
  1023.        QScrRec := VScrRec;         { Set virtual specs  }
  1024.        { ... }                     { Write to the virtual screen }
  1025.        QScrRec := CRTrec;          { Restore CRT specs when done! }
  1026.      end.
  1027.  
  1028.    Now, when you use any QWIK routine, they can be directed to the virtual
  1029.    screen - writing, reading, scrolling, wrapping, and everything you would
  1030.    expect.  Qsnow can always be false when writing to virtual screens since
  1031.    RAM is used and not video card memory.
  1032.  
  1033.    Cursor Control - One thing not available to virtual screens is cursor
  1034.    movement, because the cursor location is reserved by DOS for just video
  1035.    pages.  That means there is no cursor available for virtual screens.  So,
  1036.    how can we get around this?  The EOS marker comes to the rescue as an
  1037.    indispensable cursor!  All EOS routines can still be used as before.
  1038.  
  1039.    Taking a Peek - At some time, we will need to take a look at all or a
  1040.    portion of the virtual screen by copying it to the CRT.  Two inter-screen
  1041.    procedures do this by blocks at high speed - QScrToVscr and QVscrToScr.
  1042.    Here are the parameters of QVscrToScr:
  1043.  
  1044.      QVscrToScr (Row,Col,Rows,Cols,Vrow,Vcol,Vwidth,VScrPtr);
  1045.  
  1046.    Just like QstoreToScr, Row, Col, Rows, and Cols describe the position and
  1047.    size on the screen (Scr).  This screen is specified by QScrRec which is
  1048.    usually the CRT.  VScrPtr points to the virtual screen (Vscr).  Now, where
  1049.    is the same size block on Vscr?  It's at Vrow and Vcol.  But the Vscr may
  1050.    have a different column width than CRTcols.  So you specify that with
  1051.    Vwidth.  Only the Scr side checks for possible snow.  These procedures are
  1052.    extremely fast making virtual screens very practical.  See QScrToVscr and
  1053.    QVscrToScr in QWIKREF.DOC for more examples.
  1054.  
  1055.    Multiple Virtual Screens - By changing QScrRec, you can even copy blocks
  1056.    from one virtual screen to another!  These routines do not affect QEosOfs.
  1057.  
  1058.  
  1059.    VIDEO PAGES
  1060.  
  1061.    Multi-page Cards - TP5 procedures such as Write, Window, and GotoXY are
  1062.    dedicated to just page 0, but many video cards have more than one page.  If
  1063.    you have a CGA or better, you already have memory on your card for 4 to 8
  1064.    pages.  Since the BIOS recognizes them as well, QWIK gives you access to
  1065.    these extra pages.
  1066.  
  1067.    Page Control - QwritePage and QviewPage give you the power to use QWIK on
  1068.    all video pages and display which ever you choose.  On a multiple-video
  1069.    page card like CGA, you can simply code:
  1070.  
  1071.      QwritePage (MyPage);
  1072.  
  1073.    to make all QWIK routines be directed to your selected video page even
  1074.    though you could be viewing another page.  To view a page, you can in turn
  1075.  
  1076.  
  1077.    Chapter 4, Advanced Techniques                                      Page 18
  1078.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1079.  
  1080.  
  1081.    simply code:
  1082.  
  1083.      QviewPage (MyPage);
  1084.  
  1085.    Tips About Pages - Here are some tips to keep in mind when using several
  1086.    video pages:
  1087.  
  1088.      . The highest valid video page is detected by Qinit and saved in the
  1089.        variable MaxPage.
  1090.      . Invalid page parameters are just ignored.
  1091.      . The BIOS reserves a separate cursor location for each of up to 8
  1092.        video pages.
  1093.      . There is only one possible cursor mode which is always displayed on
  1094.        the CRT.
  1095.      . The cursor location routines operate on the page being written
  1096.        rather than viewed.
  1097.      . The current video page viewed is found with VideoPage.
  1098.      . The current video page set by QwritePage is saved in QvideoPage.
  1099.      . Be sure to end your programs with "QviewPage (0);".
  1100.  
  1101.  
  1102.    VIDEO MODES
  1103.  
  1104.    CRT Unit - If you intend to use the CRT unit with QWIK, it is best to place
  1105.    the CRT unit first in the "USES" list.  When the CRT runs its
  1106.    initialization code, it checks for the video mode to see if it is a valid
  1107.    text mode (0..3,7).  If so, it remains in that mode.  If not, it is in a
  1108.    graphics or extended column mode and is forced back into the computer's
  1109.    default text mode as set by the equipment flag at $40:$10.  By having the
  1110.    CRT unit first, you can be assured of a valid text mode when Qinit is run.
  1111.  
  1112.    Changing Text Modes - Your application may require a change in video modes
  1113.    for different row or column modes.  If so, after the mode is changed, run
  1114.    Qinit again so the video variables will be correct.
  1115.  
  1116.    TextAttr - Be advised that a change of text modes with the CRT unit will
  1117.    also change TextAttr.  It is set to what ever attribute is at the cursor.
  1118.  
  1119.    Graphic Modes - If you need to alternate with a graphics mode, Qinit does
  1120.    not need to be run provided you return back to the same text mode.  Of
  1121.    course you may want to save the screen with QstoreToMem before switching to
  1122.    graphics.
  1123.  
  1124.    Changing Monitors - The technique to change monitors is to simply change
  1125.    the text mode.  This means Qinit should be run again.  Be sure to toggle
  1126.    the video mode bits in the equipment list byte at $40:$10 so other
  1127.    applications can behave properly.
  1128.  
  1129.    CursorInitial - When QWIK is initialized, CursorInitial saves what it
  1130.    detects for the current video mode.  Whenever Qinit is run again,
  1131.    CursorInitial is also changed.  This may affect how you restore the cursor
  1132.    when terminating.  If needed, the value should be saved before using Qinit.
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.    Chapter 4, Advanced Techniques                                      Page 19
  1139.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1140.  
  1141.  
  1142.    MULTI-TASKING ENVIRONMENTS
  1143.  
  1144.    Multi-Tasking - QWIK works very well with multi-tasking environments such
  1145.    as DESQview.  For examples on how to let QWIK work in DESQview
  1146.    specifically, see a file called DESQ5X.ARC or a later version.
  1147.  
  1148.    SetMultiTask - A simple procedure has been included that generically
  1149.    detects the presence of DESQview, TopView, TaskView, OmniView, MS Windows
  1150.    or IBM 3270 PC multi-tasking video buffers (MTVB).  If they are being used,
  1151.    SetMultiTask will alter QScrPtr, Page0seg, and Qsnow correctly.  This is a
  1152.    very simple task.  All of the *.PAS files included with the code show where
  1153.    the SetMultiTask declaration is to be placed early in the program.  If you
  1154.    are unsuccessful in getting it to work as you would expect, give us a call.
  1155.  
  1156.    InMultiTask - If SetMultiTask did indeed alter QScrPtr for the MTVB, then
  1157.    InMultiTask is set to true.
  1158.  
  1159.    Multiple Video Pages - Be sure to instruct the multi-tasking environment of
  1160.    the number of video pages that are being used for your program.  Since some
  1161.    environments cannot correctly use multiple pages with the MTVB such as
  1162.    DESQview 2.01, it has been disabled in the demos with the use of
  1163.    InMultiTask.
  1164.  
  1165.    Cursor Routines and the BIOS - All cursor routines that change the mode and
  1166.    location use the BIOS.  This way multi-tasking environments can handle
  1167.    redirection properly.
  1168.  
  1169.  
  1170.    INTERRUPTS
  1171.  
  1172.    Within QWIK - QWIK only uses video interrupt $10 for Qinit and the cursor
  1173.    routines so there no problem with DOS re-entry.  Please read about "System
  1174.    Hardware" on page 22 for more information on procedure GetSubModelID which
  1175.    uses INT $15.
  1176.  
  1177.    Creating Handlers - If you use interrupt calls (like a clock display)
  1178.    within your program that use QWIK routines, be sure to save and restore the
  1179.    value of QScrRec in the call so it won't return to the main program with
  1180.    unexpected results.  You should also be aware that main program may be
  1181.    writing to a virtual screen during the interrupt, so it is best that you
  1182.    initialize a copy of a QScrRec solely for the interrupt.
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.    Chapter 4, Advanced Techniques                                      Page 20
  1200.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1201.  
  1202.  
  1203.    5.  H A R D W A R E   D E T E C T I O N
  1204.  
  1205.  
  1206.    DISPLAY COMBINATION CODE
  1207.  
  1208.    Qinit Procedure - Qinit initializes all the variables needed for the QWIK
  1209.    procedures.  And specifically checks for ALL IBM video equipment including
  1210.    dual monitors.  Qinit is initialized by the unit at start up.
  1211.  
  1212.    Display Combination Code (DCC) - The PS/2 video BIOS has a new function
  1213.    that simplifies equipment detection called the Read/Write Display
  1214.    Combination Code.  Using interrupt $10 with AH = $1A00, the call will
  1215.    return the Active Display Device in BL and the Alternate Display Device in
  1216.    BH.  If the function is supported, it also returns $1A to AL.  For the
  1217.    possible Display Device codes which have been assigned by IBM, see
  1218.    QWIKREF.DOC.
  1219.  
  1220.    Conforming to DCC - No results are obtained for the DCC on anything other
  1221.    than PS/2 equipment.  However, to be consistent, Qinit was reprogrammed to
  1222.    conform to the DCC for ALL equipment.  To see if a CGA is in use, simply
  1223.    check to see if ActiveDispDev=CgaColor.  Qinit only sets the parameters for
  1224.    the active display.
  1225.  
  1226.    Dual Monitors - Qinit detects dual monitors and saves both the active and
  1227.    alternate display device codes.  The alternate display device code is for
  1228.    testing purposes only.  If you change monitors in a running program, Qinit
  1229.    should be executed again.
  1230.  
  1231.    Testing for Dual Monitors - Qinit makes an attempt to detect for a second
  1232.    monitor by several means.  If no alternate cards like EGA or VGA are found,
  1233.    an alternate 6845 video chip (CGA, MDA, or Hercules) is checked.  If the
  1234.    chip is found, then further tests are made to find which card it could be.
  1235.    The chip existence test is highly reliable.  If no alternate display device
  1236.    is found, then AltDispDev=NoDisplay.
  1237.  
  1238.    HavePS2 - Qinit sets HavePS2 to true if the DCC is supported.  This means
  1239.    that the program has detected a PS/2 video card whether it is integrated in
  1240.    a Model 30, a PS/2 Display Adapter installed on an IBM XT, or the like.  It
  1241.    also means that either MCGA or VGA is present, but not necessarily active.
  1242.    To know which, just check the DCC.
  1243.  
  1244.    Have3270 - If Qinit detects 3270 PC equipment/software, this variable is
  1245.    set to true.  In addition, the ActiveDispDev is either MdaMono or CgaColor.
  1246.    Note: There may or may not be graphics capability in either case; Qinit is
  1247.    not meant to detect graphics.  If Have3270 is true, then ActiveDispDev3270
  1248.    will be set to the proper code.  On the 3270 PC, dual monitors are not
  1249.    possible as they use the same physical buffer space.  In addition, even
  1250.    though a color monitor maybe used, there is only one video page unless
  1251.    there is a special adapter.  However, Qinit will determine if more than
  1252.    just one page is available.  The 3270 PC also does not support 40 column
  1253.    modes.
  1254.  
  1255.    EGA Switches - By checking the value of this byte, you can determine the
  1256.    monitor connected to the EGA, the alternate video system, and the start up
  1257.    default.  The byte is a copy of how the dip switches are set on the card
  1258.  
  1259.  
  1260.    Chapter 1, Hardware Detection                                       Page 21
  1261.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1262.  
  1263.  
  1264.    where on=0 and off=1.  The primary is the default.  When the ECD is set for
  1265.    640x200, it is emulating the CD including the cursor mode.  Qinit now
  1266.    directly tests for the alternate device rather than assuming it.
  1267.  
  1268.    EGA Information - The byte located at $0040:$0087 has hardware status
  1269.    information when the EGA (or VGA) is present.
  1270.  
  1271.    PC Convertible (PCC) - Since the PCC also does not support the DCC, a
  1272.    separate code is used.  If the 5140 LCD is used in mode 7, the Active
  1273.    Display Device is set to MdaMono which is close enough.  This set up can be
  1274.    verified by testing if MaxPage=3.  The alternate display is found by using
  1275.    interrupt $10 with AH=$15.  The result is saved in AltDispDevPCC.  Of
  1276.    course the variable is undefined if a PCC is not used.
  1277.  
  1278.    Hercules - Hercules cards are also detected.  If either the active or
  1279.    alternate DCC is MdaMono, which is found by verifying a responsive 6845
  1280.    video chip at the mono register port, then an attempt is made to find if
  1281.    any Hercules card is attached.  If no Hercules card is found, then
  1282.    HercModel=NoHerc; it is then assumed that just an MDA card is attached.
  1283.    Because the test can take up to 1/3 of a second on slower computers, this
  1284.    test is only run once, even if Qinit is executed again.  The tests for the
  1285.    Hercules cards are the ones recommended by Hercules Computer Technology,
  1286.    which also admits that sometimes the tests will fail during multi-tasking
  1287.    activity.  Hercules clones may not be detected by these tests, but the DCC
  1288.    will be correct.
  1289.  
  1290.  
  1291.    SNOW CHECKING
  1292.  
  1293.    CGA Snow - QWIK is conservative with CGA cards and uses snow checking when
  1294.    the card is detected.  However, it is not needed in 40 column modes 0 and
  1295.    1.  Qinit was programmed to accommodate this.  For other hardware, you can
  1296.    change Qsnow to suit your needs, but CardSnow should be left unchanged to
  1297.    save what Qinit detected.
  1298.  
  1299.    Zenith CGA - Zenith CGAs do not need wait-for-retrace.  If you would like
  1300.    to accommodate this, you can execute the following procedure early in your
  1301.    programs and to be run after each Qinit:
  1302.  
  1303.      procedure CheckZenith;
  1304.      var  ZdsRom: array[1..8] of char absolute $F000:$800C;
  1305.      begin
  1306.        if Qsnow and (ZdsRom='ZDS CORP') then
  1307.          begin
  1308.            Qsnow    := false;
  1309.            CardSnow := false;
  1310.          end;
  1311.      end;
  1312.  
  1313.    CheckSnow - If you plan on using the standard CRT unit, place the following
  1314.    line early in your programs and after each Qinit.
  1315.  
  1316.      CheckSnow := Qsnow;
  1317.  
  1318.    Qinit appears to be more extensive in it's testing for wait-for-retrace.
  1319.  
  1320.  
  1321.    Chapter 1, Hardware Detection                                       Page 22
  1322.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1323.  
  1324.  
  1325.    Then, Write and WriteLn will work faster if DirectVideo is true.
  1326.  
  1327.    Critical Timing - The timing on the IBM PC (Intel 8088 at 4.77MHz) with a
  1328.    CGA is critical for storing characters and attributes with 16-bit transfers
  1329.    because of the CPU architecture and slow speed.  Although previous versions
  1330.    kept the timing as tight as possible, there still remained a hint of snow
  1331.    in column 1.  This is due to the problem that RAM runs a little slower than
  1332.    BIOS ROM.  This problem has now been solved with a minor code change.  So
  1333.    the routines still run at the same speed, but there is absolutely no snow!
  1334.    I am not aware of any other routines that have done this as closely.
  1335.    (Computers with slower access RAM chips may still show up some variations
  1336.    from time to time.  Feedback is requested.)
  1337.  
  1338.  
  1339.    SYSTEM HARDWARE
  1340.  
  1341.    System ID - The basic computer system identification (or model) for IBM
  1342.    computers can be found by directly accessing the byte in memory at
  1343.    $F000:$FFFE.
  1344.  
  1345.    SubModel ID - After production of the AT, models were also given Submodel
  1346.    IDs.  To get both the model and submodel ID, you must use interrupt $15
  1347.    with AH=$C0 which only works on some computers.  A few PC and XT clones
  1348.    like the AT&T 6300 will actually crash when this interrupt is executed due
  1349.    to BIOS bugs.  So to prevent this from happening, the procedure only lets
  1350.    SystemIDs of $FC or less get the SubModelID.  In addition, it was made into
  1351.    a separate procedure called GetSubModelID and is no longer apart of Qinit.
  1352.    So you will have to execute it yourself to get a result.  The routine is
  1353.    entirely optional and is not required by QWIK.
  1354.  
  1355.    CPU Identification - A CPU detection routine has been included for Intel
  1356.    processors.  It is useful for clones that do not recognize IBM's system ID
  1357.    scheme.  The idea came from Juan Jimenez as it appeared in Jan/Feb '88
  1358.    Turbo Technix magazine.  The routine has been simplified for reduced code
  1359.    (only 42 bytes) and enables use of simple constant identifiers.  This
  1360.    routine is required for Qscroll*.
  1361.  
  1362.  
  1363.    TIPS
  1364.  
  1365.    EgaMono - You should be aware that another constant also named EGAMono is
  1366.    used by the DetectGraph procedure in the Graph unit, but fortunately, they
  1367.    have the same value!
  1368.  
  1369.    Longer names - If you wish to be more explicit with procedure, function,
  1370.    and variable names, you can always add the unit name as a prefix:
  1371.  
  1372.      Qwik.GotoRC (1,1);
  1373.      MyCols:=Qwik.CRTcols;
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.    Chapter 1, Hardware Detection                                       Page 23
  1383.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1384.  
  1385.  
  1386.    A P P E N D I X   A :  V I D E O   M O D E   T A B L E
  1387.  
  1388.  
  1389.    Video Modes - To help you figure out how the all IBM video systems are
  1390.    configured, it is helpful to have a table of all the possible Alphanumeric
  1391.    (A/N or text) modes.  QWIK was not designed for the All Points Addressable
  1392.    (APA or graphics) modes.
  1393.  
  1394.              TABLE 1: Hardware Specific Video Mode Characteristics
  1395. -------------------------------------------------------------------------------
  1396. Mode Format Segment Display Box  MDA CGA EGA MCGA VGA PCjr PCC 3270 HGC MaxPage
  1397. ---- ------ ------- ------- ---- --- --- --- ---- --- ---- --- ---- --- -------
  1398. 0,1  40x25  B800:0  320x200 8x8       x   x   x    x   x    x              7
  1399.                     320x350 8x14          x        x                       7
  1400.                     320x400 8x16              x                            7
  1401.                     360x400 9x16                   x                       7
  1402. 2,3  80x25  B800:0  640x200 8x8       x                x    x              3
  1403.                     640x200 8x8           x        x                       7 *
  1404.                     640x350 8x14          x        x                       7 *
  1405.                     640x400 8x16              x                            7
  1406.                     720x350 9x14                                x          0+
  1407.                     720x400 9x16                   x                       7
  1408. 7    80x25  B000:0  720x350 9x14  x                         x   x    x     0
  1409.                     720x350 9x14          x        x                       7 *
  1410.                     720x400 9x16                   x                       7
  1411.                     640x200 8x8                             x              3
  1412. -------------------------------------------------------------------------------
  1413.  
  1414.      Legend:
  1415.      Format  - Characters per row by the number of rows in the data area.
  1416.      Segment - Address of the first character on page 0 of the display
  1417.                buffer.
  1418.      Display - The pixel resolution for the data area excluding the
  1419.                border, horizontal by vertical.
  1420.      Box     - The pixel resolution for each character, horizontal by
  1421.                vertical.
  1422.      MDA     - Monochrome Display and Printer Adapter
  1423.      CGA     - Color Graphics Adapter
  1424.      EGA     - Enhanced Graphics Adapter
  1425.      PGC     - Professional Graphics Controller
  1426.      MCGA    - Multi-Color Graphics Array
  1427.      VGA     - Video Graphics Array
  1428.      PCjr    - PC Junior
  1429.      PCC     - PC Convertible
  1430.      HGC     - Hercules Graphics Cards - HGC, HGC Plus, and InColor Card
  1431.      3270    - All IBM 3270 PC adapters
  1432.      MaxPage - 0-based highest page number; e.g. 7 means there are 8
  1433.                pages.
  1434.      MD      - 5151 Monochrome Display
  1435.      CD      - 5153 Color Display
  1436.      ECD     - 5154 Enhanced Color Display
  1437.  
  1438.      Notes:
  1439.      1. The 0 and 2 modes suppress color burst only on composite displays
  1440.         (not RGB) only for CGA and EGA.
  1441.  
  1442.  
  1443.    Appendix A: Video Mode Table                                        Page 24
  1444.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1445.  
  1446.  
  1447.      2. The PS/2 model 25 and 30 have an integrated MCGA.  The model
  1448.         30/286, model 50 and above have an integrated VGA.
  1449.      3. The 8514 High Content Color Display along with the 8514/A adapter
  1450.         produces a superset of the VGA for APA, but there are no
  1451.         differences in the A/N modes to the VGA when the adapter is in
  1452.         "VGA" mode.  See IBM documentation for Advanced Function Mode.
  1453.      4. MaxPage is reduced to 3 if EGA only has 64K graphics memory
  1454.         installed for modes marked "*".  MaxPage of 7 is for 128K or more.
  1455.      5. The PCC can have either an alternate MDA or CGA.  The LCD (model
  1456.         5140) can emulate either the MDA or CGA modes, but the MDA mode is
  1457.         640x200.
  1458.      6. No information is provided on the PGC.
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.    Appendix A: Video Mode Table                                        Page 25
  1505.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1506.  
  1507.  
  1508.    A P P E N D I X   B :  C U R S O R   M O D E   D A T A
  1509.  
  1510.    Each video card differs in character cell size and cursor emulation in
  1511.    different video modes.  The following data will show you the specific
  1512.    differences between modes and cards, and how QWIK handles them.
  1513.  
  1514.  
  1515.    CURSOR MODE TABLES
  1516.  
  1517.    Cursor Mode Word - The cursor mode is saved in low memory at $40:$60 after
  1518.    each mode change.  Using hex is the easiest way to analyze the word.  The
  1519.    shape of the cursor is defined by horizontal scan lines in the character
  1520.    cell where the top row is of any cell is 0.
  1521.  
  1522.                           TABLE 2: Cursor Mode Word
  1523.               -------------------------------------------------
  1524.                       Hi byte                  Lo byte
  1525.               -----------------------   -----------------------
  1526.      Bit #:   15 14 13 12 11 10 09 08   07 06 05 04 03 02 01 00
  1527.      Bit #:   07 06 05 04 03 02 01 00   07 06 05 04 03 02 01 00
  1528.      Symbol:      $  $  *  *  *  *  *       @  @  +  +  +  +  +
  1529.  
  1530.      Key:     $ - controls cursor on/off and erratic blinking
  1531.               * - controls top scan line (0-based)
  1532.               @ - controls skew to the right
  1533.               + - controls bottom scan line (0-based)
  1534.  
  1535.  
  1536.    Skew - Bits 5 and 6 control the skew or shift to the right of the cursor on
  1537.    EGA/VGA cards.  Consistent results between video cards is not possible so
  1538.    it is best to leave these bits at zero.
  1539.  
  1540.    Cell Sizes - Because of different cells sized with different video cards,
  1541.    the top and bottom scan lines are also different for each card.  See TABLE
  1542.    1 in Appendix A for specific cell sizes.
  1543.  
  1544.                     TABLE 2: Cursor Mode Defaults
  1545.      ----------------------------------------------------------
  1546.      Adapter   Default  Comments
  1547.      --------  -------  ---------------------------------------
  1548.      MDA       $0B0C
  1549.      CGA,MCGA  $0607
  1550.      EGA       $0B0C    MD, ECD (640x350 25-line) Emulation off
  1551.      EGA       $0607    CD, ECD (640x200)
  1552.      VGA       $0D0E    Emulation off
  1553.      3270 PC   $0D0D    And converts MDA and CGA
  1554.  
  1555.  
  1556.    CURSOR EMULATION
  1557.  
  1558.    Cursor Emulation - Qinit sets the four standard cursor mode variables at
  1559.    startup to be either MDA or CGA defaults.  Almost all emulation modes can
  1560.    be handled by either of these two cell sizes.  Qinit handles certain
  1561.    exceptions.  If you want to handle your own exceptions, the following notes
  1562.    will help you.
  1563.  
  1564.  
  1565.    Appendix B: Cursor Mode Data                                        Page 26
  1566.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1567.  
  1568.  
  1569.  
  1570.    CursorBlink - This mode is hardware specific.  It works on MDA and CGA
  1571.    while it turns the cursor off on EGA and VGA.
  1572.  
  1573.    MCGA/VGA Cursor Mode - On these two cards, you can both read and write the
  1574.    cursor mode direct from the CRTC.  To be compatible with all video cards,
  1575.    QWIK does not attempt to do this, but instead depends on the Video Display
  1576.    Data Area at $40:$60.  Qinit turns on the cursor emulation mode if PS/2
  1577.    video equipment is detected.
  1578.  
  1579.    EGA Cursor Emulation - In 25-line mode on the EGA, cursor emulation works
  1580.    fairly well.  In other line modes, the emulation falters.  So just like CRT
  1581.    unit, Qinit forces emulation to be turned on in 25-line mode and off in
  1582.    other modes.  On the EGA, emulation is turned off by setting bit 0 of
  1583.    EgaInfo to 1.  The standard QWIK cursor modes are still set appropriately.
  1584.  
  1585.    MCGA Cursor Emulation - Use the CGA cursor cell size even though the
  1586.    character cell is 8x16.  The BIOS multiplies the start and end rows by 2
  1587.    and then adds one to the end row before writing to the hardware video port
  1588.    to emulate the CGA.
  1589.  
  1590.    VGA Cursor Emulation - Qinit turns the cursor emulation mode on so you
  1591.    don't have to worry about special fonts and cells sizes as it emulates the
  1592.    MDA and CGA.  The video BIOS will adjust your cursor shape to fit in the
  1593.    current cell size.  For the algorithms specific to the VGA, refer to the
  1594.    "IBM BIOS Interface Technical Reference Manual".
  1595.  
  1596.    3270 PC Peculiarities - The 3270 PC cursor types are limited to only three.
  1597.    In addition, the underline cursor is not visible on a white background on
  1598.    the 5272 color display and it is advisable to use a block cursor together
  1599.    with that attribute.  Notice that half-block cursors are converted to full
  1600.    block:
  1601.  
  1602.                      TABLE 3: 3270 PC Cursor Modes
  1603.      --------------------------------------------------------------
  1604.      Cursor Type   Comments
  1605.      ------------  ------------------------------------------------
  1606.      Underline     $0D0D only.  CGA and MDA are emulated.
  1607.      Hidden (off)  cursor start > cursor end.  $2000 is preferred.
  1608.      Block         anything other than the above
  1609.  
  1610.  
  1611.    Start Up Cursor Modes - Once QWIK determines the cell size and the cursor
  1612.    emulation mode, the four standard cursor modes, CursorInitial,
  1613.    CursorUnderline, CursorHalfBlock and CursorBlock are calculated:
  1614.  
  1615.        CursorInitial - This is the cursor mode detected at startup.  An
  1616.        improper default for MDA is automatically overridden to an
  1617.        underline.  Some early PCs have a BIOS bug that sets the MDA
  1618.        default incorrectly.
  1619.  
  1620.        CursorUnderline - The lower scan line is set to: (BottomOfCell-1).
  1621.        The upper scan line is set to: (LowerScan-1).
  1622.  
  1623.        CursorHalfBlock - The top scan line is set to: (BottomOfCell+1)/2.
  1624.  
  1625.  
  1626.    Appendix B: Cursor Mode Data                                        Page 27
  1627.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1628.  
  1629.  
  1630.        This may appear a little fat for EGAs in 25-line mode, but is just
  1631.        right for all other cards and modes.
  1632.  
  1633.        CursorBlock - Produces a block cursor by setting the top scan line
  1634.        to zero of CursorUnderline.
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.    Appendix B: Cursor Mode Data                                        Page 28
  1688.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1689.  
  1690.  
  1691.    A P P E N D I X   C :   P E R F O R M A N C E
  1692.  
  1693.  
  1694.    CODE SIZE
  1695.  
  1696.    If you use a QWIK procedure, only the corresponding object file containing
  1697.    that procedure will be linked and thereby optimizing the code.  Even if all
  1698.    procedures are used, QWIK is still quite small at a total of 2528 bytes
  1699.    while the STRS unit is 240 bytes.  Here's the linked code size:
  1700.  
  1701.      FILE NAME    BYTES  PROCEDURES
  1702.      ------------ -----  -------------------------------------------------
  1703.      Qinit   .obj  592   Qinit - always linked when QWIK is USEd
  1704.      Qwrites .obj  350   Qwrite, QwriteC, QwriteA, QwriteEos, QwriteEosA
  1705.      Qfills  .obj  439   Qfill, Qattr, QfillC, QattrC, QfillEos, QattrEos
  1706.      Qstores .obj  293   QstoreToScr, QstoreToMem, QScrToVscr, QVscrToScr
  1707.      Qreads  .obj  127   QreadStr, QreadChar, QreadAttr
  1708.      Qscrolls.obj  269   QscrollUp, QscrollDown
  1709.      Qpages  .obj   61   QwritePage, QviewPage
  1710.      Cursor  .obj   96   GotoRC, WhereR/C, SetCursor, GetCursor, ModCursor
  1711.      Eos     .obj  131   GotoEos, EosR/C, EosToRC/rel, EosToCursor, EosLn
  1712.      QEosLn  .obj   37   QEosLn
  1713.      CpuIdent.obj   42   GetCpuID
  1714.      GetSubID.obj   27   GetSubModelID
  1715.      SetMulti.obj   27   SetMultiTask
  1716.      Qwik    .tpu   32   Initialize and paragraph round up
  1717.  
  1718.  
  1719.    SPEED
  1720.  
  1721.    How fast is fast?  To have a basis for comparision, a unit of
  1722.    "screens/second" is used to get a feeling for speed.  To make one screen, a
  1723.    procedure is repeated with a FOR loop to fill several 80x25 pages and
  1724.    timed.  Qwrite- uses 80 character strings, and Qattr and Qfill use Rows:=25
  1725.    and Cols:=80.  Here are some samples from the systems that have been
  1726.    tested.  16-bit video cards such as the one in the Compaq 386/20 will be
  1727.    much faster than 8-bit cards.
  1728.  
  1729.      ------------------ S C R E E N S / S E C O N D -----------------
  1730.                 Chng  XT(4.77 MHz)  M30    M50    M70    ATT+  Compaq
  1731.      Procedure  Attr  EGA     CGA   MCGA   VGA    VGA    CGA   386/20
  1732.      ---------  ----  ------------  -----  -----  -----  ----  ------
  1733.      Qwrite-     Yes   32.8   9.5    75.4   88.4  113.3  16.8   418.4
  1734.                  No    42.4   9.5    90.0  138.1  191.9  16.8   450.4
  1735.      Qfill-      Yes   81.2  11.8   164.1  147.3  151.0  21.5   579.6
  1736.                  No    73.7   7.4   141.3  174.4  251.0  13.9   574.9
  1737.      Qattr-      Yes   72.6   7.4   141.3  174.4  254.9  14.0   570.3
  1738.      Qstore-     n/a   59.1   7.2   111.6  127.4  139.4  13.8   351.8
  1739.      Qscroll-    n/a   32.9   5.6    62.2   71.1   77.7  16.8   317.9
  1740.  
  1741.    Be sure to test QBENCH.PAS for virtual screens and find another significant
  1742.    increase in speed.  All routines will be at least 100 Scr/Sec, and 500
  1743.    Scr/Sec is typical.
  1744.  
  1745.    For those interested in comparisons, QWIK is much faster than the TP5
  1746.  
  1747.  
  1748.    Appendix C: Performance                                             Page 29
  1749.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1750.  
  1751.  
  1752.    direct video routines by the following percentage:
  1753.  
  1754.      Procedure  CGA cards  All Other cards
  1755.      ---------  ---------  ---------------
  1756.      Writeln     125%       650%
  1757.  
  1758.  
  1759.    TP COMPILERS
  1760.  
  1761.    The source code will compile under all TP compilers from 4.0 upward.  There
  1762.    are two evaluation packages: for TP 5.0 and TP 5.5.
  1763.  
  1764.    If you have the source code and want to recompile QWIK, be sure to use the
  1765.    correct directives at the top of the file by locating the "$" on the
  1766.    appropriate line.  This a simple but important task.  The important
  1767.    directive in TP5 is the alignment directive $A-.  It must be turned off or
  1768.    QScrRec will not be addressed correctly.
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  
  1805.  
  1806.  
  1807.  
  1808.  
  1809.    Appendix C: Performance                                             Page 30
  1810.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1811.  
  1812.  
  1813.    A P P E N D I X   D :  A P P L I C A T I O N   P R O D U C T S
  1814.  
  1815.  
  1816.    Eagle Performance Software has developed identical products for both Turbo
  1817.    C and Turbo Pascal.  Our pledge is to provide you quality products with
  1818.    unparalleled performance and ease of use.  All registered users receive the
  1819.    complete source code when a signed license agreement is returned.
  1820.  
  1821.  
  1822.    QWIK
  1823.  
  1824.    QWIK - Here are the product versions and release dates for QWIK utilities:
  1825.  
  1826.       File name    CIS Name    Compiler  Release date
  1827.       -----------  ----------  --------  ------------
  1828.       QWIK55.ARC   QWIK55.ARC  TP4-5.5    08-24-89
  1829.       QWIKC21.ARC  QWKC21.ARC  TC2        07-06-89
  1830.  
  1831.  
  1832.    WNDW
  1833.  
  1834.    WNDW - For multi-level virtual windows, WNDW is the highest performance
  1835.    window utilities available today.  It offers very powerful utilities for
  1836.    full window control and management you probably never thought possible.
  1837.    They are simple and yet very powerful with high speed and tight code.  With
  1838.    WNDW, you can choose the absolute writing routines of QWIK, the window-
  1839.    relative writing routines of WNDW, and even customize your own.  Here are
  1840.    some of the features you will discover:
  1841.  
  1842.      - Uses the powerful direct screen writing routines of QWIK.
  1843.      - Up to 254 fixed or virtual windows can be on the screen at one
  1844.        time.
  1845.      - Extremely high-speed virtual screens in RAM (up to 40 times
  1846.        faster).
  1847.      - Virtual windows are fully updated on screen, even if covered.
  1848.        Screens can scroll underneath one another right on the screen at
  1849.        very high speeds!
  1850.      - Virtual windows have virtual titles.
  1851.      - Fully supported hidden windows saved in RAM.
  1852.      - Fully supports all video pages.
  1853.      - Adjustable-rate moving, resizing, and scrolling.
  1854.      - All windows can be randomly accessed, not just stacked or tiled.
  1855.      - 28 window-relative writing routines.
  1856.      - 15 different border styles with shadow and zoom effects.
  1857.      - Full line drawing procedures.
  1858.      - Full cursor mode control for each window.
  1859.      - Writes in all text modes and column modes.
  1860.      - Only 13k bytes of code if all 69 utilities are used.
  1861.      - Used in all other Eagle products.
  1862.      - Excellent documentation like this document.
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.    Appendix D: Application Products                                    Page 31
  1871.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1872.  
  1873.  
  1874.    Here are the product versions:
  1875.  
  1876.       File name    CIS Name    Compiler  Release date
  1877.       -----------  ----------  --------  ------------
  1878.       WNDW55.ARC   WNDW55.ARC  TP4-5.5    08-24-89
  1879.       WNDWC21.ARC  WNDC21.ARC  TC2        08-01-89
  1880.  
  1881.  
  1882.    PULL
  1883.  
  1884.    PULL - For multi-level pull-down menus, PULL is fully featured and fully
  1885.    configurable.  Includes execute, single, and multiple choice menus,
  1886.    unlimited nested submenus, data entry windows, help windows, directory
  1887.    windows, message system, and fully completed interfaces.  Some of the
  1888.    features are:
  1889.  
  1890.      - Uses QWIK and WNDW.
  1891.      - Work window(s) and complete interface for menus
  1892.      - Pull-down menus with 3 menu modes and 7 line modes
  1893.      - Pull-down file directory
  1894.      - Highlighted command letters
  1895.      - Unlimited levels of submenus
  1896.      - Unlimited data entry windows for 9 types of data
  1897.      - Data entry for the work window(s)
  1898.         Free field entry with either fixed column or flexible column
  1899.          length.
  1900.         Full editing capability including insert cursor mode
  1901.         Full field selection with cursor keys
  1902.         Automatic NumLock for numerical data entry
  1903.         Right or left justification for data entry output
  1904.         Error messages for invalid data entries
  1905.         Error messages for data entries out of range
  1906.      - Automatic sizes and locations for menus.
  1907.      - Operation by cursor
  1908.        keys or command keys
  1909.      - Pull/Pop between work window and nested submenu(s)
  1910.      - Programmable control of pull and pop sequences
  1911.      - Context-sensitive help
  1912.      - Message lines for prompts and processing
  1913.      - Full working shell for user development
  1914.      - Excellent documentation like this document.
  1915.  
  1916.    Here are the product versions:
  1917.  
  1918.       File name    CIS Name    Compiler  Release date
  1919.       -----------  ----------  --------  ------------
  1920.       PULL55.ARC   PULL55.ARC  TP4-5.5    08-24-89
  1921.       PULLC21.ARC  PULC21.ARC  TC2        08-01-89
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.    Appendix D: Application Products                                    Page 32
  1932.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1933.  
  1934.  
  1935.    ON-LINE SERVICES
  1936.  
  1937.    CompuServe - All updated files and later versions can be found on the
  1938.    CompuServe Borland Forums (GO BPROGA for TP and GO BPROGB for TC) or the
  1939.    IBM Programming Forum (GO IBMPRO).
  1940.  
  1941.    The Eagle BBS - You can also get the latest files on our 24-hour BBS at
  1942.    (214) 539-9878, 1200/2400 N81.
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.    Appendix D: Application Products                                    Page 33
  1993.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1994.  
  1995.  
  1996.    A P P E N D I X   E :  R E V I S I O N   H I S T O R Y
  1997.  
  1998.  
  1999.    Pre-QWIK40 Versions - Here's a list of steps to help you upgrade to
  2000.    QWIK42 from versions prior to QWIK40 on your programs:
  2001.  
  2002.      1. Add "Uses Qwik;"
  2003.      2. Delete the first Qinit.
  2004.      3. Do a search and replace for the following names.
  2005.           Search     Replace with
  2006.           ---------  ---------------------
  2007.           CardWait   CardSnow
  2008.           Qwait      Qsnow
  2009.           QwriteLV   QwriteA
  2010.           QwriteCV   QwriteC
  2011.           QwriteV    Qwrite
  2012.           ActiveDD   ActiveDispDev
  2013.           AltDD      AltDispDev
  2014.           PCCAltDD   AltDispDevPCC
  2015.           Vmode      VideoMode
  2016.      4. Add "CheckSnow:=Qsnow" early in the program and after each Qinit
  2017.         if you use the CRT unit.
  2018.      5. See REVISIONS for changes of type.
  2019.  
  2020.    Version 4.0 (12-01-87):
  2021.      Converted QWIK30 to QWIK40 to work on Turbo Pascal 4.0.
  2022.      Deleted QwriteV and QwriteCV.
  2023.      Added WhereR and WhereC.
  2024.      Added Hercules and IBM 3270 PC detection.
  2025.      Renamed the following variables:
  2026.        From       To
  2027.        ---------- ------------
  2028.        CardWait   CardSnow
  2029.        Qwait      Qsnow
  2030.        QwriteLV   QwriteA
  2031.        QwriteCV   QwriteC
  2032.        QwriteV    Qwrite
  2033.        ActiveDD   ActiveDispDev
  2034.        AltDD      AltDispDev
  2035.        PCCAltDD   AltDispDevPCC
  2036.        Vmode      VideoMode
  2037.      Added the following variables:
  2038.        VideoPage, CRTcols, CRTrows, CardSeg, Have3270,
  2039.        ActiveDispDev3270
  2040.      Added the following constants:
  2041.        NoHerc, HgcMono, HgcPlus, HercInColor
  2042.      Types were changed on the following items:
  2043.      - Strings passed to Qwrite* are of type String rather than Str80.
  2044.        (Should not be of any consequence.)
  2045.      - The CursorChange parameters are now word.
  2046.      - EgaFontSize, CRTcolumns, CardSeg, Page0seg, Qseg, AltDispDevPCC and
  2047.        ArrayLength are now word.
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.    Appendix E: Revision History                                        Page 34
  2054.    QWIK Screen Utilities                            User's Guide, Version 5.5
  2055.  
  2056.  
  2057.    Version 4.1a (05-01-88):
  2058.      Added QwriteMore, QwriteMoreA, QfillMore, and QattrMore
  2059.        procedures.
  2060.      Added QnextOfs for the Q*More procedures.
  2061.      Improved video detection in Qinit for dual monitors, Hercules cards, and
  2062.        system hardware detection.
  2063.      Included background color constants to use instead of an attribute
  2064.        function.
  2065.      Reduced code size about 10%.
  2066.      Solved critical timing problem on IBM PC with CGA - at last!
  2067.      QWIK now uses the global variable CRTcols and not the absolute variable
  2068.        CRTcolumns for offset calculations.
  2069.  
  2070.    Version 4.1b (06-18-88):
  2071.      Separated GetSubModelID out of Qinit as an optional procedure due to BIOS
  2072.        bugs in PC/XT clones which would cause a lock up at initialization.
  2073.        New GetSubModelID now avoids those machines and QWIK should now work on
  2074.        them.
  2075.  
  2076.    Version 4.2 (10-1-88):
  2077.      For clarity, the Q*More procedures were renamed to Q*Eos.
  2078.      Added the type VScrRecType.
  2079.      Added the following constants:
  2080.        CursorOff, CursorOn, CursorBlink
  2081.      Added the following variables:
  2082.        QvideoPage, QvideoMode, QScrPtr, QScrRec,
  2083.        CursorInitial, CursorUnderline, CursorHalfBlock, CursorBlock
  2084.      Renamed the following variables for clarity:
  2085.        Qseg     -> QScrSeg
  2086.        Qofs     -> QScrOfs
  2087.        QnextOfs -> QEosOfs
  2088.      Added the following procedures and functions:
  2089.        QScrToVscr, QVscrToScr, QscrollUp, QscrollDown,
  2090.        QreadStr, QreadChar, QreadAttr,
  2091.        GotoEos, EosR, EosC, EosToRC, EosToRCrel, EosToCursor, EosLn,
  2092.        QEosLn
  2093.      Revamped the cursor procedures by deleting:
  2094.          CursorChange, CursorOn, CursorOff
  2095.        and replacing them with:
  2096.          SetCursor, GetCursor, ModCursor
  2097.      The screen base is now a FAR pointer using QScrOfs and QScrSeg pieced
  2098.        together to make QScrPtr to do virtual screens in RAM.
  2099.      GotoRC and WhereR/C now work on the "write" page instead of the viewed
  2100.        page.
  2101.      Made FirstQinit a variable instead of constant so that it would be
  2102.        initialized at each startup when executing in TP environment.  Hercules
  2103.        cards are then tested at each startup.
  2104.      Completely revised documentation.
  2105.      Added supplementary STRS unit for string functions:
  2106.        StrL, StrLF, StrR, StrRF, StrRFD
  2107.  
  2108.    Version 4.2a (10-5-88):
  2109.      QattrC fixed.  (Did not exit properly when SameAttr used.)
  2110.  
  2111.  
  2112.  
  2113.  
  2114.    Appendix E: Revision History                                        Page 35
  2115.    QWIK Screen Utilities                            User's Guide, Version 5.5
  2116.  
  2117.  
  2118.    Version 4.2b (10-15-88):
  2119.      Identifiers StrLF, StrRF, and StrRFD incorrectly labled in STRS unit as
  2120.        StrLW, StrRW, and StrRWD.  Document examples also corrected.
  2121.      Added instructions for TP5 usage (registered users only).
  2122.  
  2123.    Version 5.X (12-20-88):
  2124.      Compiled QWIK42B under TP5.  No other changes.
  2125.  
  2126.    Version 5.Xa (03-04-89):
  2127.      Add SetMultiTask procedure to set variables for Multi-tasking video
  2128.        buffers (MTVB).
  2129.      Forced null strings written to virtual buffers to leave QEosOfs
  2130.        unchanged.
  2131.  
  2132.    Version 5.5 (08-24-89):
  2133.      Compiled QWIK5XA under TP 5.5.  No other changes.
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.    Appendix E: Revision History                                        Page 36
  2176.    QWIK Screen Utilities                            User's Guide, Version 5.5
  2177.  
  2178.  
  2179.    A P P E N D I X   F :  R E F E R E N C E S  A N D   C R E D I T S
  2180.  
  2181.  
  2182.   REFERENCES
  2183.  
  2184.    PS/2 Systems - For more information on the new IBM PS/2 system, you can
  2185.    get the "Personal System/2 and Personal Computer BIOS Interface Technical
  2186.    Reference" manual.  Other references include:
  2187.  
  2188.      IBM Personal System/2 Seminar Proceedings:
  2189.        Volume 5, Number 2, Displays and Adapters, publication
  2190.          # G360-2678.
  2191.        Volume 5, Number 4, Models 50, 60, 80, VGA, BIOS and
  2192.          Programming Considerations, publication # G360-2747.
  2193.  
  2194.    3270 PC - For more information on the IBM 3270 PC, you can get the
  2195.    following publications:
  2196.  
  2197.      "3270 PC Application Development Considerations"
  2198.      "IBM 3270 Personal Computer Programming Guide", Pub # SA23-0221
  2199.      "IBM 3270 Personal Computer Control Program Reference", Pub
  2200.         # GA23-0232
  2201.  
  2202.    As always, the above information is subject to change without notice
  2203.    per IBM.
  2204.  
  2205.    Video Guide - An excellent guide for IBM and Hercules video card
  2206.    programming in text and graphics is:
  2207.  
  2208.      "Programmer's Guide to PC & PS/2 Video Systems" by Richard Wilton and
  2209.        published by Microsoft Press
  2210.  
  2211.    Trademarks - IBM is the trademark for International Business Machines
  2212.    Corp.  Turbo Pascal is a trademark of Borland International.
  2213.  
  2214.  
  2215.    CREDITS
  2216.  
  2217.    Without the assistance and original ideas from Brian Foley, these
  2218.    routines would not have been written.  And the helpful feedback from
  2219.    users has inspired more powerful routines.
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.    Appendix F: References and Credits                                  Page 37
  2237.  
  2238.